@echo off

rem 设置Java环境变量（根据实际情况修改）
set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_301
set PATH=%JAVA_HOME%\bin;%PATH%

rem 设置项目路径
set PROJECT_PATH=d:\Install\Project\Trae\UtilStore\store\unitStore

rem 编译Java类
javac -d %PROJECT_PATH%\target\classes %PROJECT_PATH%\src\main\java\cn\js\sangu\unitStore\fix\FixTemplateNameColumn.java

rem 检查编译是否成功
if %ERRORLEVEL% EQU 0 (
    echo 编译成功，开始执行修复...
    rem 运行Java类
    java -cp %PROJECT_PATH%\target\classes;%PROJECT_PATH%\lib\* cn.js.sangu.unitStore.fix.FixTemplateNameColumn
) else (
    echo 编译失败，请检查Java环境和文件路径是否正确
)

pause